<template>
	<view class="content">
		<view class="navBar">
			<view class="left">
				<navigator url="../all-activities/all-activities" open-type="switchTab">
					<uni-icons class="right-icon" type="arrowleft" size="20" color="#fff"></uni-icons>
				</navigator>
				
			</view>
			<view class="center">
				<text class="uni-tab-item-title">{{kindName}}</text>
			</view>
			<view class="right">
				<!-- <button class="right-button">关注</button> -->
				<uni-icons class="right-icon" type="redo" size="20" color="#fff"></uni-icons>
				
			</view>
		</view>
		<view class="gallery-back" :style="{backgroundImage:'url('+museumDetail.museCoverImg+')'}">
			<view style="width: 100%;height: 90rpx;"></view>
			<view class="gallery-info">
				<view class="gallery-name">{{museumDetail.museName}}</view>
				<view class="gallery-place">{{museumDetail.museAddr}}</view>
				<view class="gallery-place">
					<!-- <text style="margin-right: 20rpx;">{{galleryFans}}粉丝</text> -->
					<!-- <text>|</text> -->
					<text>{{museumDetail.liveNum}}活动在办</text>
				</view>
			</view>
			<view style="width: 100%;height: 90rpx;border-top-right-radius: 30rpx;border-top-left-radius: 30rpx;background-color: #FFFFFF;margin-top: 80rpx;text-align: center;">
				<text style="line-height: 80rpx;border-bottom: 6rpx solid #B0E3FF;font-size: 40rpx;">活动</text>
			</view>
		</view>
		<view class="interest-card" v-for="(item,index) in actData">
			<view class="img"><image :src="item.actImg"></image></view>
			<view class="text">
				<view class="int-card-text">
					<view class="name"><text>{{item.actName}}</text></view>
					<view><text>{{renderTime(item.startTime)}}-{{renderTime(item.endTime)}}</text></view>
					<view><text>{{museumDetail.museAddr}}</text></view>
				</view>
				<view class="int-card-label">
					<view class="label" v-for=" item in item.actTag">{{item}}</view>
				</view>
			</view>
		</view>
		<!-- <view class="interest-card" v-for="(item,index) in act">
			<view class="img"><image :src="item.acturl"></image></view>
			<view class="text">
				<view class="int-card-text">
					<view class="name"><text>{{item.actname}}</text></view>
					<view><text>{{item.acttime}}</text></view>
					<view><text>{{item.actplace}}</text></view>
				</view>
				<view class="int-card-label">
					<view class="label" v-for=" item in label">{{item}}</view>
				</view>
			</view>
			
		</view> -->
	</view>
</template>

<script>
	export default{
		onLoad() {
			this.getMuseumDetail(1);
			this.getAct(1);
		},
		data(){
			return{
				museumDetail: {},
				actData:[],
				galleryImg:'../../../static/activities/gallery.jpg',
				galleryName:'杭州博物馆',
				galleryPlace:'清波街道粮道山18号',
				galleryFans:668,
				galleryAct:10,
				act:[
					{
						id:1,
						acturl:"../../../static/swiper/1.jpg",
						actname:"灵感事务所",
						acttime:"2020.09.30-2020.12.31",
						actplace:"杭州  |  杭州天地二层L201"
					},
					{
						id:2,
						acturl:"../../../static/swiper/2.jpg",
						actname:"灵感事务所",
						acttime:"2020.09.30-2020.12.31",
						actplace:"杭州  |  杭州天地二层L201"
					},
					{
						id:3,
						acturl:"../../../static/swiper/3.jpg",
						actname:"灵感事务所",
						acttime:"2020.09.30-2020.12.31",
						actplace:"杭州  |  杭州天地二层L201"
					},
					{
						id:4,
						acturl:"../../../static/swiper/4.jpg",
						actname:"灵感事务所",
						acttime:"2020.09.30-2020.12.31",
						actplace:"杭州  |  杭州天地二层L201"
					}
				],
				label:["娱乐","美国","流行"]
			}
			
		},
		methods: {
			//修改时间格式：年月日
			renderTime(date) {
			  var dateee = new Date(date).toJSON();
			  return new Date(+new Date(dateee) + 8 * 3600 * 1000)
						.toISOString()
						.replace(/T/g, ' ')
						.replace(/\.[\d]{3}Z/, '') 
						.replace(/-/g, ".")
						.substring(0, 10)
			},
			getMuseumDetail(museId) {
				uni.request({
					url: "http://ronin.fun:8888/museum/detail",
					data: {
						museId: museId
					},
					success: (res) => {
						this.museumDetail = res.data.data;
						console.log(this.museumDetail)
					}
				})
			},
			getAct(museId){
				uni.request({
					url: "http://ronin.fun:8888/museum/act",
					data: {
						museId: museId
					},
					success: (res) => {
						this.actData = res.data.data.info;
						console.log(this.actData)
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.content{
		width: 100%;
		height: 100%;
		// 导航栏
		.navBar{
			z-index: 1000;
			position: fixed;
			width: 100%;
			height: 90rpx;
			display: flex;
			// background-color: #B0E3FF;
			.left{
				display: inline-block;
				height: 100%;
				width: 200rpx;
				.right-icon{
					margin-left: 20rpx;
					line-height: 90rpx;
				}
			}
			.center{
				display: inline-block;
				height: 100%;
				flex: 1;
				text-align: center;
				line-height: 90rpx;
				.uni-tab-item {
					/* #ifndef APP-PLUS */
					display: inline-block;
					/* #endif */
					flex-wrap: nowrap;
					padding-left: 10rpx;
					padding-right: 10rpx;
				}
				.uni-tab-item-title {
					color: #FFFFFF;
					font-size: 30rpx;
					font-weight: bold;
					height: 80rpx;
					line-height: 80rpx;
					flex-wrap: nowrap;
					/* #ifndef APP-PLUS */
					white-space: nowrap;
					/* #endif */
				
				}
				.uni-tab-item-title-active {
					color: #FFFFFF;
					font-weight: bold;
					font-size: 40rpx;
					// border-bottom: solid #797979;
				}
			}
			.right{
				display: inline-block;
				height: 100%;
				width: 300rpx;
				text-align: center;
				// align-items: center;
				.right-button{
					background-color: #B0E3FF;
					border-radius: 30rpx;
					color: #FFFFFF;
					font-size: 23rpx;
					width: 120rpx;
					height: 55rpx;
					display: inline-block;
					margin-top: 20rpx;
				}
				.right-icon{
					float: right;
					margin-right: 40rpx;
					line-height: 90rpx;
					
				}
			}
			
		}
		.gallery-back{
			width: 100%;
			height: 500rpx;
			position: relative;
			background-position: center;
			image{
				width: 100%;
				height: 500rpx;
			}
			.gallery-info{
				margin-left: 60rpx;
				margin-top: 60rpx;
				.gallery-name{
					color: #FFFFFF;
					font-size: 40rpx;
					font-weight: bold;
					line-height: 60rpx;
				}
				.gallery-place{
					color: #FFFFFF;
					font-size: 30rpx;
					line-height: 60rpx;
				}
				
			}
		}
		.interest-card{
			margin: 20rpx 30rpx 20rpx 30rpx;
			height: 440rpx;
			border-radius: 20rpx;
			box-shadow: 0px 2px 1px rgba(200,200,200,.30);
			.img{
				display: inline-block;
				image{
					margin: 10rpx 10rpx 10rpx 10rpx;
					width: 280rpx;
					height: 400rpx;
					border-radius: 20rpx;
				}
			}
			.text{
				display: inline-block;
				vertical-align: top;
				margin-top: 20rpx;
				.int-card-text{
					text-align: center;
					color: #797979;
					width: 380rpx;
					font-size: 30rpx;
					margin-top: 20rpx;
					line-height: 50rpx;
					margin-bottom: 20rpx;
					overflow: hidden;
					-webkit-line-clamp: 2;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					.name{
						text-align: center;
						color: #333333;
						font-weight: bold;
						font-size: 40rpx;
						line-height: 60rpx;
						margin-top: 20rpx;
						margin-bottom: 20rpx;
						overflow: hidden;
						-webkit-line-clamp: 2;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-box-orient: vertical;
					}
				}
				.int-card-label{
					vertical-align: middle;
					margin-top: 20rpx;
					.label{
						width: 120rpx;
						height: 45rpx;
						display: inline-block;
						border: 1px solid #B0E3FF;
						color: #B0E3FF;
						border-radius: 20rpx;
						text-align: center;
						overflow: hidden;
						// -webkit-line-clamp: 1;
						text-overflow: ellipsis;
						-webkit-box-orient: vertical;
					}
				}
			}
			
		}
	}
</style>
